package cn.lger.service;

import cn.lger.dao.TempDao;
import cn.lger.pojo.Temp;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Code that Changed the World
 *
 * @author Pro
 * @date 2018-06-13.
 */

@Service
public class TempService {

    @Resource
    private TempDao tempDao;

    public Temp findTempById(int id) {
        return tempDao.findTempById(id);
    }


    @Transactional(rollbackFor = Exception.class)
    public int deleteTempById(int id) {
        tempDao.deleteTempById(id);
        throw new RuntimeException();
    }
}
